#!/bin/sh

if [ "$(id -u)" != "0" ]; then
  echo "Script must be executed as root; e.g. sudo ./matlab"
else
  echo "You are root! Let's continue"
  echo "Create /mnt/hercules"
  mkdir -p /mnt/hercules
  echo "Mount nfs share"
  mount -o soft,intr,rsize=8192,wsize=8192 hercules.tue.nl:/vol/hercules/tuelocal/linux /mnt/hercules
  echo "Go to install dir"
  cd /mnt/hercules/matlab-2010b/bin
  echo "Execute matlab"
  ./matlab &
fi
   
